package com.tianhui.consignortwofei.mvp.ui.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.Button;

import com.tianhui.consignortwofei.R;
import com.tianhui.consignortwofei.mvp.model.enty.OrderOperateInfo;

import org.yczbj.ycrefreshviewlib.adapter.RecyclerArrayAdapter;
import org.yczbj.ycrefreshviewlib.holder.BaseViewHolder;

/**
 * @author fgs
 * @date 2020/9/21
 * @description
 **/
public class DetailOperateAdapter extends RecyclerArrayAdapter<OrderOperateInfo> {
    public DetailOperateAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new DetailOperateListViewHolder(parent, R.layout.item_detail_operate_operate);
    }

    private class DetailOperateListViewHolder extends BaseViewHolder<OrderOperateInfo> {

        private Button operateButton;

        public DetailOperateListViewHolder(ViewGroup parent, int res) {
            super(parent, res);
            operateButton = getView(R.id.item_detail_operate_operate_operateButton);
           addOnClickListener(R.id.item_detail_operate_operate_operateButton);
        }

        @Override
        public void setData(OrderOperateInfo data) {
            super.setData(data);
            operateButton.setText(data.operate);
        }
    }

}
